import request from "@/utils/request";

// 获取所有角色列表
export const getRoleListApi = ({page, pagesize}) =>
  request.get(`/sys/role`, {
    params: {
      page,
      pagesize,
    },
  });

// 根据id获取角色详情
export const getRoleDetailApi = (id) => request.get(`/sys/role/${id}`);

// 根据id 更新角色
export const updateRoleApi = (data) => request.put(`/sys/role/${data.id}`,data)

// 根据id 删除角色
export const delRoleApi = (id) => request.delete(`/sys/role/${id}`);

// 添加角色
export const addRoleApi = (data) => request.post("/sys/role", data);

// 根据id查询企业
export const getCompanyInfoApi = (id) => request.get(`/company/${id}`);

// 给角色分配权限
// export const
